﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Snooze.Model
{
    using Castle.ActiveRecord;
    using System.Runtime.Serialization;
    using System.Xml.Serialization;

    [ActiveRecord]
    public class Person : Persistent

    {
        #region members
        private string name = string.Empty;
        private int age = 33;
        private string photo_url = string.Empty;

        private AppConfig snoozeApp;
        private IList<Alarm> alarms = new List<Alarm>();

        
        #endregion

        public Person() { }
       
        public Person(string name)
        {
            this.name = name;
        }

        #region public persistent properties
        [Property]
        public string Name
        {
            get { return name; }
            set { name = value; }
        }
        [Property]
        public string PhotoUrl
        {
            get { return photo_url; }
            set { photo_url = value; }
        }
        [Property]
        public int Age
        {
            get { return age; }
            set { age = value; }
        }

        [HasMany]
        public IList<Alarm> Alarms
        {
            get { return alarms; }
            set { alarms = value; }
        }
        #endregion

        public AppConfig SnoozeApp
        {
            get { return snoozeApp; }
            set { snoozeApp = value; }
        }

    }
}
